package com.own.component.util.excel.util.write.method;

import com.own.component.util.excel.util.write.function.AfterSheetFunction;
import com.own.component.util.excel.util.write.function.AfterWorkbookFunction;
import com.own.component.util.excel.util.write.function.GetWorkbookFunction;
import com.own.component.util.excel.util.write.method.base.BaseMetaData;

import java.io.File;

/**
 * BaseExcelMethod
 *
 * @author chenxueli
 * @date 2022-06-15 03:14:15
 */
public interface BaseExcelMethod extends BaseWriteMethod, BaseMetaData {

    /**
     * 写入excel到文件
     *
     * @param path                  路径
     * @param getWorkbookFunction   获取workbook方法
     * @param afterSheetFunction    sheet方法
     * @param afterWorkbookFunction workbook方法
     * @return 文件对象
     */
    @Override
    default File write(String path, GetWorkbookFunction getWorkbookFunction, AfterSheetFunction afterSheetFunction, AfterWorkbookFunction afterWorkbookFunction) {
        return new ExcelWriteUtil().write(excel(), path, getWorkbookFunction, afterSheetFunction, afterWorkbookFunction);
    }

}
